package com.hx.myapp.recyclerview;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import com.hx.myapp.R;

public class RecycleViewActivity extends AppCompatActivity implements View.OnClickListener{
    private Button mBtnLinear,mBtnHor,mBtnGrid,mBtnPu;
    private Intent intent = null;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_recycle_view);
        mBtnLinear = findViewById(R.id.btn_linear);
        mBtnHor = findViewById(R.id.btn_hor);
        mBtnGrid = findViewById(R.id.btn_grid);
        mBtnPu = findViewById(R.id.btn_pu);
        mBtnLinear.setOnClickListener(this);
        mBtnHor.setOnClickListener(this);
        mBtnGrid.setOnClickListener(this);
        mBtnPu.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.btn_hor:
                intent = new Intent(RecycleViewActivity.this,HorRecylerViewActivity.class);
                startActivity(intent);
                break;
            case R.id.btn_linear:
                intent = new Intent(RecycleViewActivity.this,LinearRecyclerViewActivity.class);
                startActivity(intent);
                break;
            case R.id.btn_grid:
                intent = new Intent(RecycleViewActivity.this,GridRecyclerViewActivity.class);
                startActivity(intent);
                break;
            case R.id.btn_pu:
                intent = new Intent(RecycleViewActivity.this,PuRecycleViewActivity.class);
                startActivity(intent);
                break;
        }
    }
}